import request from '@/utils/request'
/**
 * 获取组织架构列表
 * @returns
 */
export const getDepartmentListApi = () => {
  return request({
    url: '/company/department'
  })
}
/**
 * 删除部门
 * @param {*} id 部门id
 * @returns
 */
export const delDepartmentApi = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
/**
 * 获取部门负责人
 * @returns
 */
export const getDepartmentManagerListApi = () => {
  return request({
    url: '/sys/user/simple'
  })
}
/**
 * 添加部门列表
 * @param {*} data 收集的form值
 * @returns
 */
export const addDepartmentApi = (data) => {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}
/**
 * 获取部门详情
 * @param {*} id 部门id
 * @returns
 */
export const getDepartmentDetailApi = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}
/**
 * 要修改的部门接口
 * @param {*} data form参数
 * @returns
 */
export const editDepartmentApi = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
